package com.bigkoo.convenientbannerdemo;

import java.util.ArrayList;

import com.bigkoo.convenientbanner.ConvenientBanner;
import com.bigkoo.convenientbanner.holder.CBViewHolderCreator;
import com.bigkoo.convenientbanner.listener.OnItemClickListener;
import com.bigkoo.convenientbannerdemo.LocalImageHolderView;
import com.gd67.android.lib.convenientbaner.R;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager.PageTransformer;
import android.view.Menu;
import android.view.MenuItem;
import android.view.animation.Transformation;

public class MainActivity extends Activity implements OnItemClickListener {

	 private ArrayList<Integer> localImages = new ArrayList<Integer>();
	 private String[] images = {"http://img2.imgtn.bdimg.com/it/u=3093785514,1341050958&fm=21&gp=0.jpg",
	            "http://img2.3lian.com/2014/f2/37/d/40.jpg",
	            "http://d.3987.com/sqmy_131219/001.jpg",
	            "http://img2.3lian.com/2014/f2/37/d/39.jpg",
	            "http://www.8kmm.com/UploadFiles/2012/8/201208140920132659.jpg",
	            "http://f.hiphotos.baidu.com/image/h%3D200/sign=1478eb74d5a20cf45990f9df460b4b0c/d058ccbf6c81800a5422e5fdb43533fa838b4779.jpg",
	            "http://f.hiphotos.baidu.com/image/pic/item/09fa513d269759ee50f1971ab6fb43166c22dfba.jpg"
	    };
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
//		localImages.add( R.drawable.ic_test_0);
//		localImages.add( R.drawable.ic_test_1);
//		localImages.add( R.drawable.ic_test_2);
		ConvenientBanner convenientBanner=(ConvenientBanner) findViewById(R.id.convenientBanner1);
		convenientBanner.setPages(
                new CBViewHolderCreator<LocalImageHolderView>() {
                    @Override
                    public LocalImageHolderView createHolder() {
                        return new LocalImageHolderView();
                    }
                }, localImages)
                //设置两个点图片作为翻页指示器，不设置则没有指示器，可以根据自己需求自行配合自己的指示器,不需要圆点指示器可用不设
                .setPageIndicator(new int[]{R.drawable.ic_page_indicator, R.drawable.ic_page_indicator_focused})
                //设置指示器的方向
//                .setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.ALIGN_PARENT_RIGHT)
//                .setOnPageChangeListener(this)//监听翻页事件
                .setOnItemClickListener(this);
	}
	@Override
	public void onItemClick(int position) {
		// TODO Auto-generated method stub
		
	}
}
